{% extends "base.html" %}

{% block head_title %} ravings {% endblock head_title %}

{% block head_includes %}<link href="/b/rss/" title="RSS 2.0" type="application/rss+xml" rel="alternate"/>{% endblock head_includes %}

{# finish yer damn breadcrumbs ! http://www.martin-geber.com/weblog/2007/10/25/breadcrumbs-django-templates/  #}
{# and perhaps a dynamic menu - http://www.rossp.org/blog/2007/nov/27/menus/ - #}

{% block subnav_description %}
  {% include "blog/subnav_desc.html" %}
{% endblock subnav_description %}

{% block sidebar %}
  {% include "blog/sidebar.html" %}
{% endblock sidebar %}


{% block content %}
  {% load comments %}
  {% load comment_utils %}
  {% load tagging_tags %}

  {% for object in latest %}
    {% spaceless %}
    <div class="blogpost">
      {% if object.enable_comments %}
      {% get_public_free_comment_count for blog.post object.id as comment_count %}
      {% endif %}

      {% tags_for_object object as post_tags %}
      <h1><a id="{{ object.slug }}" href="{{ object.get_absolute_url }}">{{ object.title }}</a></h1>
      <br/>

      {% with object.body|length as bodylength %}
      {{ object.body|safe|truncatewords:80 }} 
      {% endwith %}
      <br/>
      
      {% if object.enclosure %}<a href="{{ object.get_enclosure_url }}">Download Podcast</a> {% endif %}
      <br/>

      <div class="descr">
        <b>Posted on {{ object.pub_date|date:"F j, Y" }} at {{ object.pub_date|date:"P"}}</b>
        {% if object.enable_comments %}

        | <a href="{{ object.get_absolute_url }}#comments" class='commentlink'>{{ comment_count }} Comment{{ comment_count|pluralize }}</a>
        {% endif %}

        <br/>

        <span class="tags">Tags: {% for tag in post_tags %}{% if not forloop.first %}, {% endif %}<a href="/b/tags/{{ tag }}">{{ tag }}</a>{% endfor %}</span></div>
      {% endspaceless %}
    </div>
    <br/>
  {% endfor %}
{% endblock %}
